/**
 * 书籍封面表
 */
 module.exports = function (sequelize, DataTypes,Model) {
    class BookImageModel extends Model {
    }
    BookImageModel.init({
        id: {
            type: DataTypes.INTEGER,
            primaryKey: true,
            autoIncrement: true,
            comment:"主键"
        },
        filename: {
            type: DataTypes.STRING,
            allowNull: false,
            comment:"文件名"
        },
        mimetype: {
            type: DataTypes.STRING,
            allowNull: true,
            comment: "文件类型",
        },
        size: {
            type: DataTypes.STRING,
            allowNull: true,
            comment: "文件大小",
        },
        bookId: {
            type: DataTypes.INTEGER,
            foreignKey:false,
            allowNull: true,
            comment: "书籍id",
        }
    }, {
        sequelize,
        modelName:"bookImage"
    })
    return BookImageModel
}